
Security News
Crates.io Implements Trusted Publishing Support
Crates.io adds Trusted Publishing support, enabling secure GitHub Actions-based crate releases without long-lived API tokens.
nodejs 下文件相关封装
'use strict';
var q = require('qiao-file');
var test = function () {
var folderPath = './test/';
var filePath = './qiao-file.js';
// cp folder
q.cp(folderPath, './test1');
// cp file
q.cp(filePath, './1.js');
};
test();
'use strict';
var q = require('qiao-file');
var test = function () {
var oldPath = './test';
var newPath = './test1';
var res = q.mv(oldPath, newPath);
console.log(res);
};
test();
'use strict';
var q = require('qiao-file');
var test = function () {
var folderPath = 'd:/test1/';
var filePath = 'd:/test.png';
// rm folder
q.rm(folderPath);
// rm file
q.rm(filePath);
};
test();
'use strict';
var q = require('qiao-file');
var test = function () {
var foldersAndFiles = q.lsdir('z:/workspaces/qiao.plugin.coder/');
console.log(foldersAndFiles);
};
test();
'use strict';
var q = require('qiao-file');
var test = function () {
var fileTree = q.lstree('./', ['node_modules']);
console.log(JSON.stringify(fileTree));
};
test();
'use strict';
var q = require('qiao-file');
var test = function () {
var folder = 'd:/test1/test2/test3/test.js';
q.mkdir(folder);
};
test();
'use strict';
var q = require('qiao-file');
var test = function () {
var filePath = 'd:/test1/test2/test.js';
var s = q.extname(filePath);
console.log(s);
};
test();
'use strict';
var q = require('qiao-file');
var test = function () {
var filePath = './index.js';
var s = q.readFile(filePath);
console.log(s);
};
test();
'use strict';
// q
var q = require('qiao-file');
// run
async function test() {
var filePath = './rm.js';
q.readFileLineByLine(filePath, onLine, onClose);
}
test();
// on line
function onLine(line) {
console.log(line);
}
// on close
function onClose() {
console.log('close');
}
'use strict';
// q
var q = require('qiao-file');
// run
async function test() {
var filePath = './rm.js';
var lines = await q.readFileLineByLineSync(filePath);
console.log(lines);
// clear
filePath = null;
lines = null;
}
test();
'use strict';
var q = require('qiao-file');
var test = function () {
var filePath = './1.js';
q.writeFile(filePath, '2');
};
test();
'use strict';
// q
var q = require('qiao-file');
// run
async function test() {
var filePath = './rm.js';
var destPath = '../dist/rm.js';
var lines = await q.readFileLineByLineSync(filePath);
q.writeFileFromLines(destPath, lines);
// clear
filePath = null;
destPath = null;
lines = null;
}
test();
'use strict';
var q = require('qiao-file');
var test = function () {
var fpath = 'z:/workspaces/qiao.plugin.coder/lib/qiao.plugin.coder.js';
var s = q.isExists(fpath);
console.log(s);
};
test();
FAQs
nodejs file tool
The npm package qiao-file receives a total of 168 weekly downloads. As such, qiao-file popularity was classified as not popular.
We found that qiao-file demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Crates.io adds Trusted Publishing support, enabling secure GitHub Actions-based crate releases without long-lived API tokens.
Research
/Security News
Undocumented protestware found in 28 npm packages disrupts UI for Russian-language users visiting Russian and Belarusian domains.
Research
/Security News
North Korean threat actors deploy 67 malicious npm packages using the newly discovered XORIndex malware loader.